/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (c) 2013-2014 jfinal app. jfapp Group.
 */

define(['adminapp'], function ($app) {
    $app.navactive('wx_reply');

    var action_tpl = Handlebars.compile($(g.actiontpl).html());

    $app.listtable({
        'sAjaxSource' : g.ctx + "admin/wx/message/replyList",
        'aoColumns'   : [
            $app.checkall,
            $app.autono,
            {'mDataProp': 'keyword' },
            {'mDataProp': 'message_type' }
        ],
        'aoColumnDefs': [
            {
                'aTargets': [3],
                'mData'   : null,
                'mRender' : function (data, type, full) {
                    return full['message_type'] == 'true' ?  "文本消息" : "图文消息";
                }
            },
            {
                'aTargets': [4],
                'mData'   : null,
                'mRender' : function (data, type, full) {
                    return action_tpl(full);
                }
            }
        ]
    }, 'data-list');
});